#include<bits/stdc++.h>
#define int long long
#define N 200005
using namespace std;
int n,k,m;
int a[N],h[N];
int b[N],l=1;
int vis[N];
int res,ans=1e18;
bool cmp(int x,int y){
    return h[x]<h[y];
}
void dfs(int x,int y){
    if(x>n){
        ans=min(ans,res);
        return;
    }
    for(int i=1;i<=n;i++){
        if(vis[i]) continue;
        vis[i]=1;
        res+=((h[i]+y-1)/y-1)*a[i];
        dfs(x+1,max(y,a[i]));
        res-=((h[i]+y-1)/y-1)*a[i];
        vis[i]=0;
    }
}
void DFS(int x,int y){
    if(clock()>=1.93*CLOCKS_PER_SEC){
        printf("%lld",ans);
        exit(0);
    }
    if(res>=ans) return;
    if(x>n){
        ans=res;
        return;
    }
    int top=l;
    for(int i=l;i<=n;i++){
        if(vis[b[i]]) continue;
        vis[b[i]]=1;
        int o=((h[b[i]]+y-1)/y-1)*a[b[i]];
        res+=o;
        while(vis[b[l]]) l++;
        DFS(x+1,max(y,a[b[i]]));
        res-=o;
        l=top;
        vis[b[i]]=0;
        if(!o) break;
    }
}
signed main(){
    freopen("xinyue.in","r",stdin);
    freopen("xinyue.out","w",stdout);
    scanf("%lld %lld",&n,&k);
    for(int i=1;i<=n;i++) scanf("%lld %lld",&a[i],&h[i]);
    if(n<=10){
        dfs(1,k);
        printf("%lld",ans);
        return 0;
    }
    for(int i=1;i<=n;i++) b[i]=i;
    sort(b+1,b+n+1,cmp);
    DFS(1,k);
    printf("%lld",ans);
    return 0;
}